using System;

namespace GameFramework.Download
{
    /// <summary>
    /// 下载代理辅助器接口
    /// </summary>
    public interface IDownloadAgentHelper
    {
        /// <summary>
        /// 下载代理辅助器更新数据流事件
        /// </summary>
        event EventHandler<DownloadAgentHelperUpdateBytesEventArgs> DownloadAgentHelperUpdateBytes;
        
        /// <summary>
        /// 下载代理辅助器更新数据大小事件
        /// </summary>
        event EventHandler<DownloadAgenthelperUpdateLengthEventArgs> DownloadAgentHelperUpdateLength;

        /// <summary>
        /// 下载代理辅助器完成事件
        /// </summary>
        event EventHandler<DownloadAgentHelperCompleteEventArgs> DownloadAgentHelperComplete;

        /// <summary>
        /// 下载代理辅助器错误事件
        /// </summary>
        event EventHandler<DownloadAgentHelperErroeEventArgs> DownloadAgentHelperError;

        /// <summary>
        /// 通过下载代理辅助器下载指定地址的数据
        /// </summary>
        /// <param name="downloadUri"></param>
        /// <param name="userData"></param>
        void Download(string downloadUri, object userData);

        /// <summary>
        /// 通过下载代理辅助器下载指定地址的数据
        /// </summary>
        /// <param name="downloadUri"></param>
        /// <param name="fronPosition"></param>
        /// <param name="userData"></param>
        void Download(string downloadUri, int fronPosition, object userData);

        /// <summary>
        /// 通过下载代理辅助器下载指定地址的数据
        /// </summary>
        /// <param name="downloadUri"></param>
        /// <param name="fromPosition"></param>
        /// <param name="toPosition"></param>
        /// <param name="userData"></param>
        void Download(string downloadUri, int fromPosition, int toPosition, object userData);

        /// <summary>
        /// 重置下载代理辅助器
        /// </summary>
        void Reset();
    }
}